﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Globalization;
using System.Runtime.Serialization;
namespace GSLMS.Entity
{
	/// <summary>
	/// 立顶申请赎楼信息表
	/// </summary>
	[DataContract(IsReference = true)]
	public partial class TB_APP_PROFORHOUINFO: IObjectWithChangeTracker, INotifyPropertyChanged
	{
		public TB_APP_PROFORHOUINFO()
		{}
		#region Model
		private long _id;
		private long _proid;
		private long _reginfoid;
		private string _tradeby;
		private int _forhoutype;
		private int _busstype;
		private string _houadd;
		private string _tenright;
		private string _tenbank;
		private string _tensubback;
		private Nullable<DateTime> _tenenddate;
		private decimal _tenleftamt;
		private decimal _houprice;
		private decimal _houtotalprice;
		private decimal _downpayamt;
		private decimal _firstpayamt;
		private string _paymod;
		private string _paybank;
		private string _paysubbank;
		private decimal _promiseamt;
		private string _cougua1;
		private string _verifild1;
		private string _cougua2;
		private string _verifild2;
		private string _signman;
		private int _sparefield1;
		private string _sparefield2;
		private string _sparefield3;
		/// <summary>
		/// 主键ID主键ID，唯一
		/// </summary>
		[DataMember]
		public long ID
		{
			get{return _id;}
			set{
				if ( _id!= value)
				{
					if (ChangeTracker.ChangeTrackingEnabled && ChangeTracker.State != ObjectState.Added)
					{
						throw new InvalidOperationException("属性“ID”是对象键的一部分，不可更改。仅当未跟踪对象或对象处于“已添加”状态时，才能对键属性进行更改。");
					}
					 _id = value;
					OnPropertyChanged("ID");
				}
			}
		}
		/// <summary>
		/// 立项申请记录ID
		/// </summary>
		[DataMember]
		public long PROID
		{
			get{return _proid;}
			set{
				if ( _proid!= value)
				{
					 _proid = value;
					OnPropertyChanged("PROID");
				}
			}
		}
		/// <summary>
		/// 申请登记记录ID
		/// </summary>
		[DataMember]
		public long REGINFOID
		{
			get{return _reginfoid;}
			set{
				if ( _reginfoid!= value)
				{
					 _reginfoid = value;
					OnPropertyChanged("REGINFOID");
				}
			}
		}
		/// <summary>
		/// 交易相对方
		/// </summary>
		[DataMember]
		public string TRADEBY
		{
			get{return _tradeby;}
			set{
				if ( _tradeby!= value)
				{
					 _tradeby = value;
					OnPropertyChanged("TRADEBY");
				}
			}
		}
		/// <summary>
		/// 赎楼方式
		/// </summary>
		[DataMember]
		public int FORHOUTYPE
		{
			get{return _forhoutype;}
			set{
				if ( _forhoutype!= value)
				{
					 _forhoutype = value;
					OnPropertyChanged("FORHOUTYPE");
				}
			}
		}
		/// <summary>
		/// 业务类型
		/// </summary>
		[DataMember]
		public int BUSSTYPE
		{
			get{return _busstype;}
			set{
				if ( _busstype!= value)
				{
					 _busstype = value;
					OnPropertyChanged("BUSSTYPE");
				}
			}
		}
		/// <summary>
		/// 物业位置
		/// </summary>
		[DataMember]
		public string HOUADD
		{
			get{return _houadd;}
			set{
				if ( _houadd!= value)
				{
					 _houadd = value;
					OnPropertyChanged("HOUADD");
				}
			}
		}
		/// <summary>
		/// 物业权属权利人
		/// </summary>
		[DataMember]
		public string TENRIGHT
		{
			get{return _tenright;}
			set{
				if ( _tenright!= value)
				{
					 _tenright = value;
					OnPropertyChanged("TENRIGHT");
				}
			}
		}
		/// <summary>
		/// 物业权属抵押银行
		/// </summary>
		[DataMember]
		public string TENBANK
		{
			get{return _tenbank;}
			set{
				if ( _tenbank!= value)
				{
					 _tenbank = value;
					OnPropertyChanged("TENBANK");
				}
			}
		}
		/// <summary>
		/// 物业权属抵押支行
		/// </summary>
		[DataMember]
		public string TENSUBBACK
		{
			get{return _tensubback;}
			set{
				if ( _tensubback!= value)
				{
					 _tensubback = value;
					OnPropertyChanged("TENSUBBACK");
				}
			}
		}
		/// <summary>
		/// 物业权属截至日期
		/// </summary>
		[DataMember]
		public Nullable<DateTime> TENENDDATE
		{
			get{return _tenenddate;}
			set{
				if ( _tenenddate!= value)
				{
					 _tenenddate = value;
					OnPropertyChanged("TENENDDATE");
				}
			}
		}
		/// <summary>
		/// 物业权属尚欠款项
		/// </summary>
		[DataMember]
		public decimal TENLEFTAMT
		{
			get{return _tenleftamt;}
			set{
				if ( _tenleftamt!= value)
				{
					 _tenleftamt = value;
					OnPropertyChanged("TENLEFTAMT");
				}
			}
		}
		/// <summary>
		/// 交易情况房产购建价
		/// </summary>
		[DataMember]
		public decimal HOUPRICE
		{
			get{return _houprice;}
			set{
				if ( _houprice!= value)
				{
					 _houprice = value;
					OnPropertyChanged("HOUPRICE");
				}
			}
		}
		/// <summary>
		/// 交易情况交易总价
		/// </summary>
		[DataMember]
		public decimal HOUTOTALPRICE
		{
			get{return _houtotalprice;}
			set{
				if ( _houtotalprice!= value)
				{
					 _houtotalprice = value;
					OnPropertyChanged("HOUTOTALPRICE");
				}
			}
		}
		/// <summary>
		/// 交易情况已付定金
		/// </summary>
		[DataMember]
		public decimal DOWNPAYAMT
		{
			get{return _downpayamt;}
			set{
				if ( _downpayamt!= value)
				{
					 _downpayamt = value;
					OnPropertyChanged("DOWNPAYAMT");
				}
			}
		}
		/// <summary>
		/// 交易情况首期款项
		/// </summary>
		[DataMember]
		public decimal FIRSTPAYAMT
		{
			get{return _firstpayamt;}
			set{
				if ( _firstpayamt!= value)
				{
					 _firstpayamt = value;
					OnPropertyChanged("FIRSTPAYAMT");
				}
			}
		}
		/// <summary>
		/// 交易情况付款方式
		/// </summary>
		[DataMember]
		public string PAYMOD
		{
			get{return _paymod;}
			set{
				if ( _paymod!= value)
				{
					 _paymod = value;
					OnPropertyChanged("PAYMOD");
				}
			}
		}
		/// <summary>
		/// 还款来源银行
		/// </summary>
		[DataMember]
		public string PAYBANK
		{
			get{return _paybank;}
			set{
				if ( _paybank!= value)
				{
					 _paybank = value;
					OnPropertyChanged("PAYBANK");
				}
			}
		}
		/// <summary>
		/// 还款来源支行
		/// </summary>
		[DataMember]
		public string PAYSUBBANK
		{
			get{return _paysubbank;}
			set{
				if ( _paysubbank!= value)
				{
					 _paysubbank = value;
					OnPropertyChanged("PAYSUBBANK");
				}
			}
		}
		/// <summary>
		/// 还款来源承诺金额以万元为单位
		/// </summary>
		[DataMember]
		public decimal PROMISEAMT
		{
			get{return _promiseamt;}
			set{
				if ( _promiseamt!= value)
				{
					 _promiseamt = value;
					OnPropertyChanged("PROMISEAMT");
				}
			}
		}
		/// <summary>
		/// 反担保措施文件及反担保措施1
		/// </summary>
		[DataMember]
		public string COUGUA1
		{
			get{return _cougua1;}
			set{
				if ( _cougua1!= value)
				{
					 _cougua1 = value;
					OnPropertyChanged("COUGUA1");
				}
			}
		}
		/// <summary>
		/// 落实情况1
		/// </summary>
		[DataMember]
		public string VERIFILD1
		{
			get{return _verifild1;}
			set{
				if ( _verifild1!= value)
				{
					 _verifild1 = value;
					OnPropertyChanged("VERIFILD1");
				}
			}
		}
		/// <summary>
		/// 反担保措施文件及反担保措施2
		/// </summary>
		[DataMember]
		public string COUGUA2
		{
			get{return _cougua2;}
			set{
				if ( _cougua2!= value)
				{
					 _cougua2 = value;
					OnPropertyChanged("COUGUA2");
				}
			}
		}
		/// <summary>
		/// 落实情况2
		/// </summary>
		[DataMember]
		public string VERIFILD2
		{
			get{return _verifild2;}
			set{
				if ( _verifild2!= value)
				{
					 _verifild2 = value;
					OnPropertyChanged("VERIFILD2");
				}
			}
		}
		/// <summary>
		/// 共同面签人
		/// </summary>
		[DataMember]
		public string SIGNMAN
		{
			get{return _signman;}
			set{
				if ( _signman!= value)
				{
					 _signman = value;
					OnPropertyChanged("SIGNMAN");
				}
			}
		}
		/// <summary>
		/// 预留字段1
		/// </summary>
		[DataMember]
		public int SPAREFIELD1
		{
			get{return _sparefield1;}
			set{
				if ( _sparefield1!= value)
				{
					 _sparefield1 = value;
					OnPropertyChanged("SPAREFIELD1");
				}
			}
		}
		/// <summary>
		/// 预留字段2
		/// </summary>
		[DataMember]
		public string SPAREFIELD2
		{
			get{return _sparefield2;}
			set{
				if ( _sparefield2!= value)
				{
					 _sparefield2 = value;
					OnPropertyChanged("SPAREFIELD2");
				}
			}
		}
		/// <summary>
		/// 预留字段3
		/// </summary>
		[DataMember]
		public string SPAREFIELD3
		{
			get{return _sparefield3;}
			set{
				if ( _sparefield3!= value)
				{
					 _sparefield3 = value;
					OnPropertyChanged("SPAREFIELD3");
				}
			}
		}
		#endregion Model

	#region ChangeTracking
	   
	protected virtual void OnPropertyChanged(String propertyName)
	{
	    if (ChangeTracker.State != ObjectState.Added && ChangeTracker.State != ObjectState.Deleted)
	    {
	        ChangeTracker.State = ObjectState.Modified;
	    }
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	protected virtual void OnNavigationPropertyChanged(String propertyName)
	{
	    if (_propertyChanged != null)
	    {
	        _propertyChanged(this, new PropertyChangedEventArgs(propertyName));
	    }
	}
	   
	event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged{ add { _propertyChanged += value; } remove { _propertyChanged -= value; } }
	private event PropertyChangedEventHandler _propertyChanged;
	private ObjectChangeTracker _changeTracker;
	   
	[DataMember]
	public ObjectChangeTracker ChangeTracker
	{
	    get
	    {
	        if (_changeTracker == null)
	        {
	            _changeTracker = new ObjectChangeTracker();
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	        return _changeTracker;
	    }
	    set
	    {
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging -= HandleObjectStateChanging;
	        }
	        _changeTracker = value;
	        if(_changeTracker != null)
	        {
	            _changeTracker.ObjectStateChanging += HandleObjectStateChanging;
	        }
	    }
	}
	   
	private void HandleObjectStateChanging(object sender, ObjectStateChangingEventArgs e)
	{
	    if (e.NewState == ObjectState.Deleted)
	    {
	        ClearNavigationProperties();
	    }
	}
	   
	protected bool IsDeserializing { get; private set; }
	   
	[OnDeserializing]
	public void OnDeserializingMethod(StreamingContext context)
	{
	    IsDeserializing = true;
	}
	   
	[OnDeserialized]
	public void OnDeserializedMethod(StreamingContext context)
	{
	    IsDeserializing = false;
	    ChangeTracker.ChangeTrackingEnabled = true;
	}
	   
	protected virtual void ClearNavigationProperties()
	{
	}
	
	#endregion

	}
}

